import React, { Component } from 'react'
import { Checkbox } from 'antd'
import './index.less'

const SelectDropDown = (props) => {
  return (
    <div className="common-dropdown-wrap">
      <div className="list">
        {
          props.listData && props.listData.length
            ? props.listData.map((item, index) => {
              return (
                <Checkbox
                  key={item.value}
                  checked={item.checked}
                  className={item.checked ? 'item-checkbox selected-checkedbox' : 'item-checkbox'}
                  onClick={() => props.selectedChange(index)}
                >
                  {item.text}
                </Checkbox>
              )
            }) : null
        }
      </div>
      <div className="btns">
        <span className="btn-clear common-btn" onClick={() => props.resetFn()}>重置</span>
        <span className="btn-confirm common-btn" onClick={() => props.confirmFn()}>确定</span>
      </div>
    </div>
  )
}

export default SelectDropDown
